#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui>
#include <QtNetwork>
#include <QtWebKit>
#include "queryform.h"
#include "parsetraindata.h"

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
	QueryForm * m_QueryForm;
	ParseTrainData m_Parser;
	QProgressBar * m_Progress;
	QPushButton * m_Cancel;
	void closeEvent(QCloseEvent * ce);
	QHttp * m_FirmHttp;
	FirmTrainsList m_FirmTrains;
	void RequestFirmTrains();
	void UpdateTitle(const QString & From = QString(), const QString & To = QString());
private slots:
	void on_actionAbout_triggered();
	void on_actionCollapse_triggered(bool checked);
	void on_actionNewQuery_triggered();
	void OnError(const QString & Text);
	void OnProgressUpdate(int Done, int Total);
	void OnFinished(const TrainDataList & List);
	void OnFirmTrainsPageFinished(int Id, bool _Error);
};

#endif // MAINWINDOW_H
